package com.company.java.basic.the_Shape_Factory;

import java.awt.*;

public class shape_Factory {
    public shape produceShape(String the_shape){
        shape shape = null;
        if (the_shape == "圆形"){
            shape = new Circle();
            return shape;
        }else if (the_shape == "矩形"){
            shape = new Rectangle();
            return shape;
        }else if (the_shape == "三角形"){
            shape = new Triangle();
            return shape;
        }else{
            System.out.println("请输入正确的形状");
            return shape;
        }

    }
}
